<template>
    <div class="test" v-loading="iLoading">
      <el-card class="box">
        <h3 style="text-align: center;">{{ year }}年老师信息</h3>
        <div class="box-item">
          <div>头像</div>
          <div>
            <el-avatar :src="userInfo.avatar"></el-avatar>
          </div>
        </div>
        <div class="box-item">
          <div>姓名</div>
          <div>{{ userInfo.uname }}</div>
        </div>
        <div class="box-item">
          <div>工号</div>
          <div>{{ userInfo.uaccount }}</div>
        </div>
        <div class="box-item">
          <div>性别</div>
          <div>{{ userInfo.sex == 1 ? '男' : '女' }}</div>
        </div>
  
      </el-card>
    </div>
  </template>
  
  <script>
  import { getTeacherInfo } from "@/api/student";

  export default {
    name: "stu-apply",
    data() {
      return {
        iLoading: false,
        userInfo: {
          // uID: 132456,
          // className: "软件216",
          // major: "软件工程",
          // collegeName: "计算机学院",
          // gpa: 3.50,
          // addGpa: 1.50,
          // totalGpa: 5.00,
          // createTime: "2023-08-25",
          // uName : "李俊熙"
        },
        year: new Date().getFullYear()
      }
    },
    created() {
      this.init();
    },
    methods: {
      init() {
        this.iLoading = true
        getTeacherInfo().then(res => {
          this.userInfo = res.data
          this.iLoading = false
        }).catch(err => {
          this.iLoading = false
        })
      }
    },
  };
  </script>
  
  <style scoped>
  .test {
    height: 100%;
    padding: 40px;
  }
  
  .box-card {
    margin: 10px auto;
    padding: 20px;
    height: 630px;
    /* width: 80%; */
  }
  
  .el-row {
    margin-bottom: 20px;
    /* &:last-child {
        margin-bottom: 0;
      } */
  }
  
  .box {
    margin: 0 auto;
    width: 40%;
  }
  
  .box-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
  }
  </style>